package com.ziyun.pop.common.utils;

import io.renren.modules.sys.entity.SysUserEntity;
import org.apache.shiro.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Calendar;

/**
 * @author guizhao
 * @Description: 订单工具类
 * @date 2018-09-21 11:13
 */
public class OrderUtils {
    private static Logger logger = LoggerFactory.getLogger(OrderUtils.class);

    /**
     * 获取门店生产单号
     * @param sellerId
     * @return
     */
    public static String getStoreOrderNo(int sellerId){
//        int r1=(int)(Math.random()*(10));//产生3个0-9的随机数
//        int r2=(int)(Math.random()*(10));
//        int r3=(int)(Math.random()*(10));
        long now = System.currentTimeMillis();//一个13位的时间戳
//        String orderNo =String.valueOf(r1)+String.valueOf(r2)+String.valueOf(now);// 订单ID
        String orderNo = String.valueOf(now);

        return orderNo;
    }


    public static void main(String[] args) {


    }
    /**
     * @return返回微秒
     */
    public static Long getmicTime() {
        Long cutime = System.currentTimeMillis() * 1000; // 微秒
        Long nanoTime = System.nanoTime(); // 纳秒
        return cutime + (nanoTime - nanoTime / 1000000 * 1000000) / 1000;
    }
}
